<?php

namespace app\model\activity;

use app\model\system\SystemSignReward;
use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;

class SignTask extends BaseModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'sign_task';
    protected $insert = ['create_time'];
    use ModelTrait;
    /**
     * 创建时间修改器
     * @return int
     */
    protected function setCreateTimeAttr()
    {
        return time();
    }

    protected function product()
    {
        return $this->hasOne(StoreSign::class, 'id', 'sign_product');
    }

    protected function sign()
    {
        return $this->hasOne(SystemSignReward::class, 'id', 'task_id');
    }
}